package cn.javass.dp.builder.demo1;

/**
 * 抽象生成器 该接口除了为创建一个Product对象的各个组件定义了若干个方法之外，还要定义返回Product对象的方法
 *
 */
public interface Builder {
    void buildPart();
    void buildPart1();
    void buildPart2();
}
interface Product { }

class ConcreteBuilder implements Builder {

    Product resultProduct;

    public Product getResultProduct() {
        return resultProduct;
    }

    @Override
    public void buildPart() {

    }
    @Override
    public void buildPart1() {

    }

    @Override
    public void buildPart2() {

    }
}

class Director {
    Builder builder;

    public void construct() {
        builder.buildPart2();
        builder.buildPart();
        builder.buildPart1();

    };

    public Director(Builder builder) {
        this.builder = builder;
    }


}